<template>
  <div class="chit-info-root">
<!--    <div class="chit-user">-->
<!--      <div class="head-portrait">-->
<!--        <div class="img-con">-->
<!--          <img src="@/assets/images/chit/headPortrait.png"/>-->
<!--        </div>-->
<!--      </div>-->
<!--      <div class="txt-con">-->
<!--        <div class="label-value-con imp">-->
<!--          <div class="label">保险人姓名：</div>-->
<!--          <div class="value">{{ dataItem.bxrxm }}</div>-->
<!--        </div>-->
<!--        <div class="label-value-con">-->
<!--          <div class="label">联系方式：</div>-->
<!--          <div class="value">{{ dataItem.lxfs }}</div>-->
<!--        </div>-->
<!--      </div>-->
<!--    </div>-->
    <div class="info-container">
      <div v-for="(item,index) in dataList" class="bet label-value-con">
        <div class="label">{{ item.label }}：</div>
        <div class="value">{{ item.value }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import {CHIT_DETAIL_CONFIG} from "@/constantData";

export default {
  name: "infoItem",
  props: {
    dataItem: {
      type: Object
    }
  },
  computed: {
    dataList() {
      let {dataItem} = this
      // let exception = ['bxrxm', 'sfzh']
      let exception = []
      let chitList = _.cloneDeep(CHIT_DETAIL_CONFIG).filter(item => !exception.some(cItem => cItem == item.value)).map(item => {
        let {label, value} = item;
        return {label, value: dataItem[value]}
      })
      return chitList
    }
  }
}
</script>

<style lang="scss" scoped>
.chit-info-root {
  width: 100%;

  .chit-user {
    display: flex;
    width: 100%;
    padding: 20px 16px;
    background: rgba(245, 247, 250, 1);
    flex-direction: row;
    height: 80px;


    .head-portrait {
      width: 40px;
      height: 40px;
      background: rgba(220, 223, 230, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 10px;

      .img-con {
        height: 14px;
        width: 14px;

        img {
          height: 100%;
          width: 100%;
        }
      }
    }

    .txt-con {
      height: 40px;
      width: calc(100% - 50px);
      display: flex;
      flex-direction: column;
    }
  }

  .info-container {
    width: 100%;
    padding: 15px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #fff;
  }
}
</style>
